﻿using System;

namespace YAMM.PlugInManagement.Menu.ToolBar
{
    using PlugIn; 

    class ToolStripSplitButton : System.Windows.Forms.ToolStripSplitButton, IToolStripSplitButton
    {
        YAMM.PlugInManagement.Menu.MenuBar.ToolStripItemCollection items;

        public ToolStripSplitButton()
            : base()
        {

            items = new YAMM.PlugInManagement.Menu.MenuBar.ToolStripItemCollection(this.DropDown, new System.Windows.Forms.ToolStripItem[0]);
            base.ButtonClick += delegate(object sender, EventArgs e)
            {
                if (this.Click != null)
                    this.Click(this, e);
            };
        }

        public new event EventHandler Click;

        public new void PerformClick()
        {
            if (this.Click != null)
                this.Click(this, EventArgs.Empty);
        }

        #region IToolStripSplitButton Members

        public IToolStripItemCollection Items
        {
            get { return items; }
        }

        #endregion

        #region IToolStripButton Members

        public System.Windows.Forms.Keys ShortcutKeys
        {
            get; 
            set;            
        }

        #endregion

        #region IToolStripItem Members


        public Guid Identifier
        {
            get;
            set;
        }

        #endregion
    }
}
